﻿<UserControl x:Class="SoftSource.Timecard.Views.InvoicingView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
             xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
             xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit">

    <controlsToolkit:BusyIndicator x:Name="Busy"
                                   HorizontalContentAlignment="Stretch"
                                   VerticalContentAlignment="Stretch">
        <Grid x:Name="LayoutRoot">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>

            <StackPanel Orientation="Horizontal">
                <Button Margin="10,4,4,6"
                        Click="SetBillDates_Click"
                        Content="Set Billing Dates" />
            </StackPanel>
            <data:DataGrid x:Name="InvoicingDataGrid"
                           Grid.Row="1"
                           AutoGenerateColumns="False">
                <data:DataGrid.Columns>
                    <data:DataGridTextColumn Header="Project"
                                             Binding="{Binding Project.Name}" />
                    <data:DataGridTemplateColumn>
                        <data:DataGridTemplateColumn.CellEditingTemplate>
                            <DataTemplate>
                                <controls:DatePicker SelectedDate="{Binding Project.BilledAsOf, Mode=TwoWay}" />
                            </DataTemplate>
                        </data:DataGridTemplateColumn.CellEditingTemplate>
                    </data:DataGridTemplateColumn>
                    <data:DataGridTemplateColumn Header="Invoice">
                        <data:DataGridTemplateColumn.CellEditingTemplate>
                            <DataTemplate>
                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          IsChecked="{Binding Invoice, Mode=TwoWay}" />
                            </DataTemplate>
                        </data:DataGridTemplateColumn.CellEditingTemplate>
                    </data:DataGridTemplateColumn>
                    <data:DataGridTextColumn Header="Message"
                                             Binding="{Binding Message, Mode=OneWay}" />
                </data:DataGrid.Columns>
            </data:DataGrid>
        </Grid>
    </controlsToolkit:BusyIndicator>
</UserControl>